{% extends "base_public.html" %}

{% block title %}NTU Open Course Ware (NTUOCW){% endblock %}

{% block bodyContent %}

	<div id="primaryContentContainer">
			<div id="primaryContent">
				<h2>Search all courses</h2>
	
			  <form action="." method="GET">
			    <label for="q">Search for a lecture (English or Chinese): </label>
			    <input type="text" name="q" value="{{ query|escape }}">
			    <input type="submit" value="search">
			  </form>
			
			  {% if query %}
			    <p></p>Results for <b>"{{ query|escape }}"</b>:
			
			    {% if results %}
			      <ul>
			      {% for lectureItem in results %}
			
			        <li>Lecture: <a href="/viewCourse/{{ lectureItem.id }}">{{ lectureItem.nameEN|escape }}</a></b> <br><br>
			        </li>
			        
			      {% endfor %}
			      </ul>
			    {% else %}
			      <p>No lectures found matching your query.</p>
			    {% endif %}
			  {% endif %}
			
                
			</div>
		</div>

{% endblock %}

